<?php
      include_once "../blog.php";  
      $connection = connect($config);
    
    if(isset($_POST["postTitle"]) && !empty($_POST["postTitle"]))
    {
        $query = "INSERT INTO Titles (Title, Text, PublicDate) VALUE (:title, :text, NOW())";
        $params = array
        (
            'title' => htmlspecialchars( $_POST["postTitle"] ),
            'text' =>   htmlspecialchars( $_POST["postbody"] )
              
        );
        query($query, $params, $connection);
        
        echo "Post Added";
    }
       
    
    include_once("create.view.php");
    


?>